<div class="produce list">
  <div class="feature">
  	<h2>Sản phẩm mới</h2>
  </div>
  <table class="listing" sumary="Produces list">
  	<% $i = 0 %>
	<% until $i > 5 %>
	<tr>
		<td class="center">
			<div class="textIndent">
				<% if @produces[$i] != nil %>
					<div class="tcenter">
						<%= link_to(image_tag("HOG_Blend_coffee.jpg", :alt => "HOG Blend"), {:action => 'show', :id => @produces[$i].id}, :class => 'action show') %>
					</div>

					<div class="tlink">
			  			<%= link_to(@produces[$i].origin, {:action => 'show', :id => @produces[$i].id}, :class => 'action show') %>
			  		</div>

			  		<div class="tprice">
			  			<%= @produces[$i].price %> VND
			  		</div>
		  		<% end %>
		  		<% $i = $i + 1 %>
	  		</div>
		</td>
		<td class="center">
			<div class="textIndent">
				<% if @produces[$i] != nil %>
					<div class="tcenter">
						<%= link_to(image_tag("HOG_Blend_coffee.jpg", :alt => "HOG Blend"), {:action => 'show', :id => @produces[$i].id}, :class => 'action show') %>
					</div>

					<div class="tlink">
			  			<%= link_to(@produces[$i].origin, {:action => 'show', :id => @produces[$i].id}, :class => 'action show') %>
			  		</div>

			  		<div class="tprice">
			  			<%= @produces[$i].price %> VND
			  		</div>
		  		<% end %>
		  		<% $i = $i + 1 %>
		  	</div>
		</td>
		<td class="center">
			<div class="textIndent">
				<% if @produces[$i] != nil %>
					<div class="tcenter">
						<%= link_to(image_tag("HOG_Blend_coffee.jpg", :alt => "HOG Blend"), {:action => 'show', :id => @produces[$i].id}, :class => 'action show') %>
					</div>

					<div class="tlink">
			  			<%= link_to(@produces[$i].origin, {:action => 'show', :id => @produces[$i].id}, :class => 'action show') %>
			  		</div>

			  		<div class="tprice">
			  			<%= @produces[$i].price %> VND
			  		</div>
		  		<% end %>
		  		<% $i = $i + 1 %>
		  	</div>
		</td>
	</tr>
	<% end %>
  </table>
</div>


<div class="sidebar">
	<div class="boxes">
		<div class="feature">
			<h2>Tin mới</h2>
		</div>

		<div class="indent">
		<ul>
			<% $j = 0 %>
			<% until $j > 9 %>
				<% if @news[$j] != nil %>
					<li><%= link_to(@news[$j].name, '#') %></li>
				<% end %>
				<% $j = $j + 1 %>
			<% end %>
		</ul>
		</div>
	</div>

	<div id="nextBoxes">
		<div class="feature">
			<h2>Khuyến mãi</h2>
		</div>

		<div class="indent">
		<ul>
			<% $j = 0 %>
			<% until $j > 9 %>
				<% if @news[$j] != nil %>
					<li><%= link_to(@news[$j].name, '#') %></li>
				<% end %>
				<% $j = $j + 1 %>
			<% end %>
		</ul>
		</div>
	</div>
</div>

<% if session[:user] %>
	<div class="five_produces">
		<h2>Có thể bạn sẽ thích</h2>
		<% if @pro_1 %>
			<% @pro_1.each do |p| %>
				<li><%= link_to (p.name) %></li>
			<% end %>
		<% end %>

		<% if @pro_2 %>
			<% @pro_2.each do |p| %>
				<li><%= link_to (p.name) %></li>
			<% end %>
		<% end %>

		<% if @pro_3 %>
			<% @pro_3.each do |p| %>
				<li><%= link_to (p.name) %></li>
			<% end %>
		<% end %>
	</div>
<% end %>